package com.jurenzhao.partssystem.business.order_enterprise.controller;

import com.jurenzhao.partssystem.business.order_enterprise.entity.SaleOrder;
import com.jurenzhao.partssystem.business.order_enterprise.entity.SaleOrderDetail;
import com.jurenzhao.partssystem.business.order_enterprise.service.OrderDetailService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/order_detail")
public class OrderDetailController {

    @Resource
    private OrderDetailService orderDetailService;

    @RequestMapping("/list")
    public String list(Model model){
        List<SaleOrderDetail> orderDetailList = orderDetailService.findAll();
        model.addAttribute("orderDetailList",orderDetailList);
        return "Business/Order_Enterprise/Order_Detail_List";
    }
}
